import request from "@/utils/request";

/**
 * 分页查询登录日志
 */
export async function pageLoginRecords(params) {
  const res = await request.get("/system/login-record/page", { params });
  if (res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

/**
 * 查询登录日志列表
 */
export async function listLoginRecords(params) {
  const res = await request.get("/system/login-record", { params });
  if (res.data.code === 200 && res.data.data) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

/**
 * 批量删除字典数据
 */
export async function removeLoginRecordBatch(data) {
  const res = await request.delete("/system/login-record/batch", { data });
  if (res.data.code === 200) {
    return res.data.msg;
  }
  return Promise.reject(new Error(res.data.msg));
}
